fix(faro): Block private IPs on sourcemap downloads - #6849
Open
SashaMIT wants to merge 1 commit into
Open
Conversation
faro.receiver sourcemap download used a bare http.Client with default download_from_origins=["*"], so client-controlled Filename / sourceMappingURL values could reach loopback, RFC1918, link-local, and CGNAT addresses. Reject blocked addresses before Get, re-check origin allowlist on resolved sourceMappingURL, and validate redirect hops.
Contributor
|
Hey a couple of things. Before making pr please create a issue and describe what the problem actually is, second please read our AI policy and please use the pr template that we have in alloy. |
Author
|
You're right on all three, thanks for the pointers. I've read the GenAI policy. I've opened #6870 describing the problem and linked it, and reworked the PR body into the alloy template with the AI-assistance box checked. Details and reviewer notes are in my own words. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief description of Pull Request
faro.receiversourcemap downloads now reject loopback / RFC1918 / link-local / CGNAT targets, re-checkdownload_from_originsagainst the resolved absolutesourceMappingURL, and validate redirect hops viaCheckRedirect. Tests added ininternal/component/faro/receiver.Pull Request Details
(HUMAN ONLY, write in your voice. Starting point: the default config, download=true with download_from_origins=["*"], means a stock Alloy deployment accepts faro signals from any client and fetches whatever sourcemap URL the signal points at. I treated the fetch as server-side because the pod's network position is what makes internal targets reachable. I chose a deny-list of private ranges plus redirect re-validation rather than an allow-list so public CDN sourcemaps keep working when origins permit them.)
Issue(s) fixed by this Pull Request
Fixes #6870
Notes to the Reviewer
Happy to discuss whether the private-range deny should be configurable. I kept it hard-coded because the default config is open to any client.
PR Checklist